import {
  ApplyTypeEnum,
  AuditStatusEnum,
  IsFinishEnum,
  MemberApplyFormReviewStatusEnum,
  PaymentStatusEnum,
} from '@/enums/membershipEnum';
import { type FormGroupMapItem, type FormItemVoMapItem } from '../membership/formCompTypes';
import { type customFormUserAnswerList } from '../membership/types';
import { type IQuery } from '@/api/indexTypes';
import { MemberRoleEnum } from '@/enums/memberRoleEnum';
import { PotentialClientsTypeEnum } from '@/enums/commercializeEnum';
import { IsOfficialAccountEnum } from '@/enums/loginEnum';
import type { AssTypeEnum, OrderAuditStateEnum, PhaseStateEnum } from '@/enums/orderEnum';
import { IsTop, SendStatusEnum, ReadStatusEnum } from '@/enums/admin';

export interface MemberApplyFormResult {
  id: number;
  applyType: ApplyTypeEnum;
  levelName: string;
  proposer: string;
  contactPersonName: string;
  contactPersonPhone: string;
  stageName: string;
  auditStatus: AuditStatusEnum;
  paymentStatus: PaymentStatusEnum;
  userName: string;
  phonenumber: string;
  auditUserName: string;
  createTime: string;
  auditTime?: any;
  appUserId: number;
  formStageId: number;
  isFinish: IsFinishEnum;
  customFromId: number;
  applyTemplateId: number;
  answerNo: string;
  levelId: number;
  userId: number;
  avatar: string;
  membershipFees: number;
  memberId: number;
  isSetPaymenrecord?: boolean
}
export interface IFormParame {
  filterTerm: number;
  applyTypeList: string[] | undefined;
  levelIds: string[] | undefined;
};
export interface MemberApplyFormDetailsResult {
  answerNo: string;
  appUserId: number;
  applyTemplateId: number;
  applyType: ApplyTypeEnum;
  contactPersonName: string;
  contactPersonPhone: string;
  customFromId: number;
  formStageId: number;
  id: number;
  isFinish: IsFinishEnum;
  levelId: number;
  levelName: string;
  memberCustomFormStageVoList: Array<{
    id: number;
    name: string;
    auditStatus: MemberApplyFormReviewStatusEnum;
    remark: string;
    formGroupList: FormGroupMapItem[];
    formItemVoMap: FormItemVoMapItem;
    customFormUserAnswerList: customFormUserAnswerList[];
  }>;
  memberId: number;
  paymentStatus: PaymentStatusEnum;
  proposer: string;
  companyId: number;
  companyName: string;
}

export interface MemberApplyFormReviewData {
  id: number;
  status: MemberApplyFormReviewStatusEnum;
  remark?: string;
}

export interface MemberInfoApplyResult {
  id: number;
  memberId: number;
  memberName: string;
  levelId: number;
  applyType: ApplyTypeEnum;
  submitName: string;
  appUserId: number;
  levelName: string;
  auditStatus: AuditStatusEnum;
  createTime: string;
  submitPhone: string;
  createBy?: any;
  updateBy?: string;
  updateTime?: string;
  tenantId?: number;
  submitSocialPosition?: string;
  dataJson?: string;
  beforeDataJson?: string;
  remark?: string;
  auditUserId?: number;
  auditUserName?: string;
  auditTime?: string;
}

export interface MemberInfoApplyDetailsResult {
  id: number;
  beforeInfoData: any;
  infoData: {
    customFormItemMap: FormItemVoMapItem;
    customFormUserAnswerList: customFormUserAnswerList[];
    remarks?: string;
  };
  memberName: string;
  applyType: ApplyTypeEnum;
  auditStatus: AuditStatusEnum;
  remark?: string;
  companyId: number;
  companyName?: string;
}

export interface IMemberManageListData extends IQuery {
  /** 会员名称 */
  keyword?: string;
  /** 会员类型 */
  applyType?: ApplyTypeEnum;
  /** 职务 */
  levelId?: number;
  /** 会员状态 */
  memberState?: number[];
  /** 缴费状态 */
  paymentStatus?: string;
  /** 行业 */
  industryId?: number;
  /** 服务专员 */
  server?: string;
  /** 会员分组 */
  groups?: string;
  /** 资料完整度开始 */
  beginDataIntegrity?: number;
  /** 资料完整度结束 */
  endDataIntegrity?: number;
  /** 对外公开 */
  show?: number;
  /** 是否筛选我服务的会员 */
  member?: boolean;
}

export interface IMemberManageListResData {
  applyType: ApplyTypeEnum;
  companyName: string;
  dataIntegrity: number;
  display: number;
  distance: number;
  extName: string;
  joinTime: string;
  latitude: string;
  leaderAvatar: string;
  leaderId: number;
  leaderName: string;
  leaderSocialPosition: string;
  leaderPhone: string;
  levelName: string;
  levelId: number;
  logo: string;
  longitude: string;
  memberEndTime: string;
  memberEndTimeStr: string;
  memberId: number;
  memberName: string;
  memberState: number;
  paymentStatus: number;
  postName: string;
  rating: string;
  typeName: string;
  website: string;
  companyId: number;
  memberCompanyId: number
}

export interface ISettingInfoResData {
  memberId: number;
  memberName: string;
  levelId: number;
  memberPostId: number;
  attacheUserId: string;
  joinTime: string;
  memberEndTime: string;
  groupIdList: number[];
  groupIds: string;
  memberState: number;
  dataIntegrity: number;
  sort: number;
  leadingShow: number;
  companyShow: number;
  paymentStatus: PaymentStatusEnum;
}

export interface IUpdateSettingInfoData {
  memberId: number;
  memberName: string;
  levelId: number;
  memberPostId: number;
  attacheUserId: number;
  joinTime: string;
  memberEndTime: string;
  groupIdList: number[];
  memberState: number;
  sort: number;
  leadingShow: number;
  companyShow: number;
}

export interface IAddMemberData {
  applyType: ApplyTypeEnum;
  logo?: string;
  memberName: string;
  levelId: number;
  joinTime: string;
  memberEndTime: string;
  leadingName: string;
  leadingPhone: string;
  leadingAvatar?: string;
}

export interface ILeadingMemberListData extends IQuery {
  cocId: number;
}

export interface ILeadingMemberListResData {
  id: number;
  appUserInfoId: number;
  cocId: number;
  cocName: string;
  avatar: string;
  name: string;
  phone: string;
  socialPosition: string;
  memberRoleType: MemberRoleEnum;
  isOfficialAccount: IsOfficialAccountEnum;
  isLogin: number;
  memberLeadingId: number
}

export interface ILeadingMemberAddData {
  id?: number;
  cocId: number;
  name: string;
  phone: string;
  socialPosition: string;
  memberRoleType: MemberRoleEnum;
  show?: number;
  avatar: string;
  signInImg: string;
}

export interface AdminMemberInfoResult {
  memberPostName: string;
  companyId: number;
  applyType: ApplyTypeEnum;
  groupNames: string[];
  memberEndTime: string;
  joinTime: string;
  attacheName: string;
  leadingId: number;
  contactPersonId: number;
  customFormItemMap: FormItemVoMapItem;
  customFormUserAnswerList: customFormUserAnswerList[];
}

export interface IPaymentRecordListResData {
  allottedTime: number;
  createTime: string;
  id: number;
  levelId: number;
  levelName: string;
  memberId: number;
  memberName: string;
  money: number;
  nowMoney: number;
  paymentVoucher: string;
  sysUserId: number;
  sysUserName: string;
}

export interface IPaymentRecordInfoResData {
  allottedTime: number;
  applyType: ApplyTypeEnum;
  createTime: string;
  endTime: string;
  id: number;
  levelId: number;
  levelName: string;
  memberId: number;
  memberName: string;
  money: number;
  payFileUrl: string;
  paymentStatus: number;
  paymentVoucher: string;
  remarks: string;
  replyFileUrl: string;
  startTime: string;
  sysUserId: number;
  sysUserName: string;
  time: string;
  type: number;
  year: string;
}

export interface IMemberApplyPaymentData {
  endTime: string;
  memberId: number;
  membershipFees: number;
  paymentVoucher: string;
  remarks: string;
  startTime: string;
}

export interface IApplyTemplateListResData {
  id: number;
  name: string;
}

export interface PotentialClientPageListResult {
  appUserId: number;
  avatar: string;
  userName: string;
  createTime: string;
  loginDate: string;
  phonenumber: string;
  recordNumber: number;
  expectation: number;
}

export interface PotentialClientRecordListResult {
  appUserId: number;
  type: PotentialClientsTypeEnum;
  count: number;
  name: string;
  describe: string;
}

export interface PotentialClientRecordPageListData extends IQuery {
  appUserId: number;
  type: PotentialClientsTypeEnum;
}

export interface PotentialClientRecordPageListResult {
  type: PotentialClientsTypeEnum;
  count: number;
  name: string;
  leadingId: number;
  avatar: string;
  socialPosition: string;
  memberName: string;
  companyName: string;
  leveName: string;
  dataId: number;
  applyType: number;
  createTime: string;
}

export interface ICreatePaymenrecordData {
  applyId: number;
  levelId: number;
  paymentVoucher?: string;
  startTime: string;
  endTime: string;
  payMoney: number;
  state: number;
  // isSendMsg: boolean;
  // memberPostId: number;
  // groupIdList: number[];
  // currentService: number;
  // remarks: string;
  memberOtherSettingsDto: IMemberOtherSettingsDtoData;
}
export interface IMemberOtherSettingsDtoData {
  show: number;
  memberPostId: number;
  groupIdList: number[];
  currentService: number;
  remarks: string;
}

export interface IMemberApplyByIdResult {
  memberName: string;
  levelName: string;
  levelId: number;
  nowLevelId: number;
  nowLevelName: string;
  paymentVoucher?: string;
  startTime: string;
  endTime: string;
  payMoney: number;
  state: number;
  isSendMsg: boolean;
  allottedTime: number;
  money: number;
  applyType: ApplyTypeEnum;
  memberOtherSettingsDto: IMemberOtherSettingsDtoData;
}

export interface IPayFeesReviewData {
  id: number;
  status: number;
  remark: string;
}

export interface IPaymentRecordExportData {
  memberName?: string;
  levelName?: string;
  membershipFees?: number;
  applyType?: number;
  unit?: number;
  amountPaid?: number;
}

export interface IRenewOfflineMemberOrderListResult {
  id: number;
  submitName: string;
  submitPhone: string;
  submitTime: string;
  money: number;
  payMoney: number;
  memberName: string;
  memberId: number;
  levelName?: string;
  nowLevelName: string;
  membershipFees?: number;
  applyType: number;
  auditStatus: AuditStatusEnum;
}

export interface IRenewCreatePaymenrecordData {
  memberId: number;
  levelId: number;
  paymentVoucher: string;
  startTime: string;
  endTime: string;
  payMoney: number;
  state: number;
  // isSendMsg: boolean;
}

export interface IPaymenrecordByIdResult {
  allottedTime: number;
  applyType: ApplyTypeEnum;
  auditStatus: AuditStatusEnum;
  auditTime: string;
  auditUserName: string;
  createTime: string;
  endTime: string;
  id: number;
  leadingId: number;
  leadingName: string;
  leadingPhone: string;
  levelId: number;
  levelName: string;
  memberId: number;
  memberName: string;
  money: number;
  nowLevelId: number;
  nowLevelName: string;
  orderCode: string;
  orderId: number;
  payMode: string;
  payMoney: number;
  paymentVoucher: string;
  remarks: string;
  startTime: string;
  submitName: string;
  submitPhone: string;
  submitTime: string;
  sysUserId: number;
  sysUserName: string;
  state: PaymentStatusEnum;
  updateTime: string;
}

export interface MemberContactsVo {
  memberLeadingId: number;
  leadingId: number;
  levelId: number;
  levelName: string;
  typeId?: any;
  typeName?: any;
  leadingName?: string;
  leadingAvatar?: string;
  leadingSocialPosition: string;
  memberId: number;
  orgCompanyId: number;
  companyName: string;
  companyLogo: string;
  companyAddressStr: string;
  companyMainBusiness: string;
  companyMainBusinesList: string[];
  companyFoundTime?: string;
  tenantId: number;
  orgTenantName?: string;
  applyType: ApplyTypeEnum;
  currentDistance?: string;
  distance?: string;
  memberState: number;
  attention: boolean;
  unlockLeading: boolean;
  saasMerchantIsEnable: boolean;
  orderCode?: string;
}

export interface ContactsReviewListResult {
  id: number;
  applylevelName: string;
  applyUserName: string;
  orgName: string;
  leadingName: string;
  toOrgName: string;
  phaseState: PhaseStateEnum;
  auditStatus: OrderAuditStateEnum;
  createTime: string;
  orderCode: string;
  auditUserId: number;
  toAuditUserId: number;
}

export interface ContactsDetailResult {
  applyUserAvatar: string;
  applyUserName: string;
  applyUserPhone: string;
  applylevelName: string;
  applyType: ApplyTypeEnum;
  assType: AssTypeEnum;
  auditStatus: number;
  createTime: string;
  orderCode: string;
  orderType: string;
  orgAuditReason: string;
  orgAuditStatus: number;
  orgAuditTime: string;
  orgAuditUserName: string;
  applyCompanyName: string;
  applyCompanyPositionName: string;
  orgName: string;
  orgTenantId: string;
  orglogo: string;
  payMoney: number;
  phaseState: PhaseStateEnum;
  remark: string;
  state: number;
  toOrgAuditReason: string;
  toOrgAuditStatus: number;
  toOrgAuditTime: string;
  toOrgAuditUserName: string;
  toOrgLogo: string;
  toOrgName: string;
  toOrgTenantId: string;
  totalMoney: number;
  memberContactsVo: MemberContactsVo;
  orgAuditUserId: number;
  toOrgAuditUserId: number;
}

export interface ReviewData {
  id: number;
  status: OrderAuditStateEnum;
  remark: string;
}

export interface AttachmentAddData {
  memberId: number;
  size: number;
  url: string;
  name: string;
}

export interface AttachmentListResult {
  id: number;
  name: string;
  sizeStr: string;
  createTime: string;
  url: string;
  uploadUserName: string;
}

export interface PhotosData {
  id?: number;
  name: string;
  desc: string;
  coverUrl: string;
  originalCoverUrl: string;
  belongId: number;
  publishTime: string;
  top: IsTop;
  photoDtoList?: Array<any>;
  browseNum?: number;
}

export interface EditPhotosGroupData {
  id?: number;
  name: string;
  sort: string;
}

export interface BatchUpImageData {
  belongId: number;
  coverUrl: string;
  type: number;
  name: string;
  url: string;
  size: number;
  id?: number;
}

export interface MsgTypeData {
  associatedObjects: string | null;
  customType: number;
  dataSource: string | null;
  id: number;
  name: string;
  parentId: number;
  nodeList: MsgTypeData[] | null;
}

export interface CreateMsgData {
  smsTemplateTypeId: number;
  objectId?: number;
  customPageId?: string;
  title: string;
  sendTypes: string[];
  smsTemplateId?: number;
  wechatTemplateId?: number;
  userIds: string[];

  phoneList?: string[];
  registerIds?: number[];
  leadingIds?: number[];
}

export interface SearchUserData extends IQuery {
  dataSource?: string;
  ids?: string[]
  keyword?: string;
  levelIds?: number[] | string[];
  industryIds?: number[] | string[];
  memberStateIds?: number[] | string[];
  paymentStatusIds?: number[] | string[];
  applyType?: number[] | string[];
  groupIds?: number[] | string[];
  initRoleIds?: number[] | string[];
  userIds?: string[];
  objectId?: number;
}

export interface MsgUserData {
  id: string
  applyType: number;
  avatar?: string;
  birthday?: string;
  companyName?: string;
  companyPosition?: string;
  initRole: number;
  isLogin: number;
  isOfficialAccount: number;
  joinTime: string;
  levelId?: number;
  memberEndTime: string;
  memberId: number;
  memberLevelName?: string;
  memberName?: string;
  paymentStatus?: string;
  phone?: string;
  sex?: number;
  userId: string;
  userName: string;
  wxOpenId?: string;
}

export interface MessageDetailData {
  id: number;
  typeId: number;
  typeName: string;
  associationObjectId: number;
  messageTitle: string;
  messageChannelList: any[];
  sender: string;
  sendTime: string;
  totalNum: number;
  sendSuccessNum: number;
  readNum: number;
  unionMsgId: string;
  customPageId?: string;
}

export interface SearchResultData {
  unionMsgId: string;
  position?: string;
  sendStatus?: SendStatusEnum;
  readStatus?: ReadStatusEnum;
}

export interface ResultListData {
  companyName?: string;
  companyPosition?: string;
  position?: string;
  sendStatus: SendStatusEnum;
  readStatus: ReadStatusEnum;
  recipientId: string;
  recipientName: string;
  avatar?: string;
  phoneNumber?: string;
  messageChannelInfoList: any[];
}

export interface SysMemberPageListData {
  paymentStatus: PaymentStatusEnum | null;
  keyword: string;
}

export interface SysMemberPageListResult {
  id: number;
  companyName: string;
  memberName: string;
  leadingName: string;
  nowLevelName: string
  levelName: string;
  levelId: number;
  applyType: ApplyTypeEnum;
  unit: string;
  membershipFees: number;
  joinTime: string;
  endTime: string;
  memberEndTime: string;
  paymentStatus: PaymentStatusEnum;
  daysRemainingStr: string;
  allottedTime: number;
  leadingPhone: string
}

export interface SysAuditStatisticsResult {
  /** 会员审核 */
  memberAuditNumber: number;
  /** 人脉审核 */
  contactsUnlockAuditNumber: number;
  /**活动审核 */
  activityWaitAuditNumber: number;
  /**供需审核 */
  boWaitAuditNumber: number;
}

export interface SysMemberAuditStatisticsResult {
  memberApplyAuditStatisticsVo: {
    /** 入会审核 - 待缴费 */
    unpaidPaymentNumber: number;
    /** 入会审核 - 待审核 */
    auditNumber: number;
  };
  /** 资料变更 - 待审核 */
  infoAuditNumber: number;
  /** 续费凭证待审核  */
  renewAuditNumber: number;
}

export interface SysConnectionAuditStatisticsResult {
  /** 会内待审核 */
  auditNumber: number;
  /** 会外待审核 */
  cooperationAuditNumber: number;
}
